package edu.zut.cs.network.Experiment7;
import java.util.Scanner;
import org.apache.log4j.*;

public class ParseBinary {
    private static Logger logger = Logger.getLogger(ParseBinary.class);
    public static int parseBinary(String binaryString){
        int num1 = Integer.parseInt(binaryString,2);
        return num1;
    }
    public static void main(String[] args) {
        logger.info("请输入一个二进制数：");
        Scanner input = new Scanner(System.in);
        String binaryString = input.nextLine();
        int num = parseBinary(binaryString);
        logger.info("二进制数："+binaryString+"转换十进制数为："+num);
    }
}
